package com.yuezhi.producer.controller;

import com.yuezhi.producer.constant.QueueConstant;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TTLController {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @GetMapping("/ttl")
    public void send(String msg) {
        rabbitTemplate.convertAndSend(QueueConstant.TTL_EXCHANGE,"ttl",msg);
    }
}
